import type { BasicStatus, MenuType } from "./enum";
import React from "react";

export interface UserToken {
	tokenName?: string;
	tokenValue?: string;
}

export interface Tenant {
	id: React.Key;
	tenantCode: string;
	tenantName: string;
	status: BasicStatus;
}

export interface UserInfo {
	id: number | string;
	account?: string;
	password?: string;
	name?: string;
	orgName?: string;
	orgId?: string;
	gender?: string;
	email?: string;
	phone?: string;
	userPic?: string;
	status?: number;
	roles?: Role[];
	menus?: Menu[];
	permissions?: string[];
	tokenName?: string;
	tokenValue?: string;
	tenant: Tenant;
}

export interface Organization {
	id: string;
	name: string;
	status: BasicStatus;
	description?: string;
	children?: Organization[];
}

export interface Menu {
	id: string;
	parentId?: string;
	name: string;
	label: string;
	type: MenuType;
	route: string;
	status?: BasicStatus;
	sn?: number;
	icon?: string;
	component?: string;
	permission?: string;
	hidden?: string;
	hideTab?: boolean;
	frameSrc?: URL;
	newFeature?: boolean;
	children?: Menu[];
}

export interface Role {
	id: string;
	code: string;
	name: string;
	status: BasicStatus;
	description?: string;
	permission?: Menu[];
}

export interface Dict {
	id: number;
	dictCode: string;
	dictName: string;
	description?: string;
	status: number;
}

export interface DictItem {
	id: number;
	dictId: number;
	dictCode: string;
	itemText: string;
	itemValue: string;
	description?: string;
	sort: number;
	status: number;
}

export interface Action {
	label: string;
	type: string;
	clickHandler: (record: any) => void;
}
